# coding=utf-8
"""
Author: Mr.夏末
@Function: 功能名称
"""
import requests

# 3.token验证
session = requests.session()
res = session.post("http://www.testingedu.com.cn:8081/inter/HTTP/auth")
session.headers['token'] = res.json().get('token')
#登录
res = session.post("http://www.testingedu.com.cn:8081/inter/HTTP/login",
                    data={
                        'username': 'hzs01',
                        'password': '123456'
                    })
print(res.text)
# 退出登录
res = session.post("http://www.testingedu.com.cn:8081/inter/HTTP/logout")
print(res.text)


# 3.token验证
session = requests.session()
res = session.post("http://www.testingedu.com.cn:8081/inter/HTTP/auth")
session.headers['token'] = res.json().get('token')
#登录
res = session.post("http://www.testingedu.com.cn:8081/inter/HTTP/login",
                    data={
                        'username': 'hzs01',
                        'password': '1234567'
                    })
print(res.text)
# 退出登录
res = session.post("http://www.testingedu.com.cn:8081/inter/HTTP/logout")
print(res.text)